﻿package view.popup.control
{
    import com.greensock.*;
    import com.sh.game.global.*;
    import flash.events.*;
    import flash.geom.*;
    import manager.*;
    import uiresource.popup.*;

    public class XfeiCtrl extends XfeiUI implements IDialogUI
    {

        public function XfeiCtrl()
        {
            return;
        }// end function

        override protected function initializeView() : void
        {
            super.initializeView();
            vipBtn.addEventListener(MouseEvent.CLICK, this.vipbtnClickHandler);
            colseBtn.addEventListener(MouseEvent.CLICK, this.closeClickHandler);
            this.x = (GlobalLayer.instance.root.stage.stageWidth - this.width) / 2 + 16;
            this.y = (GlobalLayer.instance.root.stage.stageHeight - this.height) / 2 - 90;
            return;
        }// end function

        protected function resizeHandler(event:Event) : void
        {
            this.x = (GlobalLayer.instance.root.stage.stageWidth - this.width) / 2 + 16;
            this.y = (GlobalLayer.instance.root.stage.stageHeight - this.height) / 2 - 90;
            return;
        }// end function

        protected function closeClickHandler(event:MouseEvent) : void
        {
            this.visible = false;
            return;
        }// end function

        protected function vipbtnClickHandler(event:MouseEvent) : void
        {
            this.visible = false;
            PluginManager.instance.changePlugin("vip", new Point(100, 100));
            return;
        }// end function

        public function show(param1:Object) : void
        {
            this.visible = true;
            this.alpha = 0;
            TweenMax.to(this, 0.2, {alpha:1});
            return;
        }// end function

        public function close() : void
        {
            this.visible = false;
            return;
        }// end function

    }
}
